package com.peng.service;

import com.peng.pojo.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

@FeignClient(name = "springcloud-provider-dept",fallbackFactory = DeptClientServiceFallbackFactory.class)
@Component
public interface DeptClientService {
    @PostMapping("/dept/add")
    boolean addDept(Dept dept);

    @GetMapping("/dept/id/{id}")
    Dept queryId(@PathVariable("id") long id);

    @GetMapping("/dept/all")
    List<Dept> queryList();
}
